
<#include "header.ftl">
  <!-- 内容区域 -->
<div class="tpl-content-wrapper">

   <div class="container-fluid am-cf">
                <div class="row">
                     <div class="am-u-sm-12 am-u-md-12 am-u-lg-9">
                        <ol class="am-breadcrumb">
						  <li><a href="${Domain}my" class="am-icon-home">首页</a></li>
						  <li class="am-active">个人信息</li>
						  <li class="am-active">重置密码</li>
						</ol>
                    </div>
                  	<#include "../common/return.ftl">
                </div>

</div>
  <div class="row-content am-cf">
          <div class="row">

                    <div class="am-u-sm-12 am-u-md-12 am-u-lg-12">
                        <div class="widget am-cf">
                            <div class="widget-head am-cf">
                                <div class="widget-title am-fl">个人密码修改</div>
                                
                            </div>
                            <div class="widget-body am-fr">

                                <form class="am-form tpl-form-line-form"  method="post" action="${Domain}api/user/resetpwd" id="user-update">
                                    <div class="am-form-group">
                                        <label  class="am-u-sm-3 am-u-md-3 am-form-label">原始密码 </label>
                                        <div class="am-u-sm-8 am-u-md-6">
                                            <input type="password" class="tpl-form-input" id="pwd" name="pwd" placeholder="请输入原密码" required/>
                                        </div>
                                         <label  class="am-u-sm-1 am-u-md-3"></label>
                                    </div>

                                    <div class="am-form-group">
                                        <label  class="am-u-sm-3 am-u-md-3 am-form-label">新设密码 </label>
                                        <div class="am-u-sm-8 am-u-md-6">
                                            <input type="password" class="tpl-form-input" id="password" name="password" minlength="6" maxlength="20"  placeholder="请输入新密码(6-20字符)" required/>
                                        </div>
                                         <label  class="am-u-sm-1 am-u-md-3"></label>
                                    </div>
									<div class="am-form-group">
                                        <label  class="am-u-sm-3 am-u-md-3 am-form-label">重复密码 </label>
                                        <div class="am-u-sm-8 am-u-md-6" class="">
                                            <input type="password" class="tpl-form-input" id="rpwd" name="rpwd" minlength="6" placeholder="请再次输入新密码" required/>
                                        </div>
                                         <label  class="am-u-sm-1 am-u-md-3"></label>
                                    </div>
                                    
                                	 <div class="am-form-group">
                                        <div class="am-u-sm-6 am-u-sm-push-3">
                                            <button type="submit" class="am-btn page-header-button tpl-btn-bg-color-success am-btn-block">重置密码</button>
                                        </div>
                                    </div>
                                </form>
                            </div>
                        </div>
                    </div>
                </div>
            
   </div>
</div>  
     


<script type="text/javascript">
  var loading ;
 $(function() {

  $('#user-update').validator({
    onValid: function(validity) {
   
      $(validity.field).closest('.am-form-group').find('.am-alert').hide();
    },
    onInValid: function(validity) {
   
      var $field = $(validity.field);
      var $group = $field.closest('.am-form-group');
      var $tpl = $group.find('.tpl-form-input');
      var $alert = $group.find('.am-alert');
      // 使用自定义的提示信息 或 插件内置的提示信息
      var msg = $tpl.data('validationMessage') || this.getValidationMessage(validity);

      if (!$alert.length) {
        $alert = $('<div class="am-alert am-alert-danger"></div>').hide().
          insertAfter($tpl);
          
      }

      $alert.html(msg).show();
    }
  });
});
  
  
   $('#user-update').ajaxForm({
	    beforeSubmit: function(a,f,o) {
	    	if($("#password").val()!=$("#rpwd").val())
	    	{
	    	   weui.alert("两次密码不一样，请从新输入！"); 
	    	   return false;
	    	}
	    	if($("#password").val().length==0)return false;
	        loading=weui.loading('数据加载中...');
	    },
	    success: function(json) {	    	
	    	if(json.status)
	    	{
	    	  	if(loading) loading.hide();
	    		weui.toast(json.msg);   			
	    	}else
	    	{	
	    		if(loading) loading.hide();
	    	    weui.alert(json.msg);  		 
	    	}
	    }
	});
	</script>
<#include "footer.ftl">